package com.yan.design.two.behavior.s5.g1;

import com.yan.design.observer.OrderService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 5. 观察者模式
 *     测试类
 * @author shengren.yan
 * @create 2022-08-10
 */
public class testRun {

    // 观察者模式 -- make1方法
    @Autowired
    OrderService orderService;

    public static void main(String[] args) {

        Subject sub = new Subject("sub");
        Subject2 s1 = new Subject2("s1");
        Subject3 s2 = new Subject3("s2");
        Subject2 s3 = new Subject2("s3");
        //注册观察者
        sub.addObserver(s1);
        sub.addObserver(s2);
        sub.modify("hungry");


    }
}
